翻訳と辞書
Words near each other
・ Intefiqer
・ Integer
・ Integer (computer science)
・ Integer BASIC
・ Integer broom topology
・ Integer circuit
・ Integer complexity
・ Integer factorization
・ Integer factorization records
・ Integer function
・ Integer lattice
・ Integer literal
・ Integer matrix
・ Integer Matrix Library
・ INTEGER Millennium House
Integer overflow
・ Integer points in convex polyhedra
・ Integer programming
・ Integer relation algorithm
・ Integer sequence
・ Integer sequence prime
・ Integer set library
・ Integer sorting
・ Integer square root
・ Integer triangle
・ Integer-valued function
・ Integer-valued polynomial
・ Intego
・ Integra
・ Integra Air


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Integer overflow : ウィキペディア英語版
Integer overflow

In computer programming, an integer overflow occurs when an arithmetic operation attempts to create a numeric value that is too large to be represented within the available storage space. For instance, taking the arithmetic mean of two numbers by adding them and dividing by two, as done in many search algorithms, causes error if the sum (although not the resulting mean) is too large to be represented, and hence overflows.〔(Google Research blog: Nearly All Binary Searches and Mergesorts are Broken, Joshua Bloch, 2 June 2006 )〕 The most common result of an overflow is that the least significant representable bits of the result are stored; the result is said to ''wrap''. On some processors like GPUs and DSPs, the result saturates; that is, once the maximum value is reached, any attempt to increase it always returns the maximum integer value.
== Origin ==

The register width of a processor determines the range of values that can be represented. Typical binary register widths include:
* 8 bits: maximum representable value 28 − 1 = 255
* 16 bits: maximum representable value 216 − 1 = 65,535
* 32 bits: maximum representable value 232 − 1 = 4,294,967,295 (the most common width for personal computers ),
* 64 bits: maximum representable value 264 − 1 = 18,446,744,073,709,551,615 (the most common width for personal computers, but not necessarily their operating systems, ),
* 128 bits: maximum representable value 2128 − 1 = 340,282,366,920,938,463,463,374,607,431,768,211,455
Since an arithmetic operation may produce a result larger than the maximum representable value, a potential error condition may result. In the C programming language, signed integer overflow causes undefined behavior, while unsigned integer overflow causes the number to be reduced modulo a power of two, meaning that unsigned integers "wrap around" on overflow. This "wrap around" is the cause of the famous "Split Screen" in Pac-Man.〔(【引用サイトリンク】title=The Pac-Man Dossier )
A "wrap around" corresponds to the fact, that e.g. if the addition of two positive integers produces an overflow, it may result in an unexpected result. For example with unsigned 32 bit integers, 4000000000u + 1000000000u = 705032704u.

In computer graphics or signal processing, it is typical to work on data that ranges from 0 to 1 or from −1 to 1. An example of this is a grayscale image where 0 represents black, 1 represents white, and values in-between represent varying shades of gray. One operation that one may want to support is brightening the image by multiplying every pixel by a constant. Saturated arithmetic allows one to just blindly multiply every pixel by that constant without worrying about overflow by just sticking to a reasonable outcome that all these pixels larger than 1 (i.e. "brighter than white") just become white and all values "darker than black" just become black.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Integer overflow」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.